//package com.plian.system.controller.wf;
//
//import com.plian.Tools.pagedata.PageData;
//import com.plian.system.model.CommonCode;
//import com.plian.system.model.ListResult;
//import com.plian.system.model.ObjResult;
//import org.flowable.common.engine.api.repository.EngineResource;
//import org.flowable.engine.RepositoryService;
//import org.flowable.engine.impl.persistence.entity.DeploymentEntityImpl;
//import org.flowable.engine.repository.Deployment;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.transaction.annotation.Transactional;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
///**
// * 活动流程管理
// */
//@RestController
//@RequestMapping("/api/activity-model/")
//public class ActivityModelController {
//
//    @Autowired(required = false)
//    private RepositoryService repositoryService;
//
//    @RequestMapping("list")
//    public ListResult list() {
//        List<Deployment> deploymentList = repositoryService
//                .createDeploymentQuery()
//                .orderByDeploymenTime()
//                .desc()
//                .list();
//
//        Map<String, EngineResource> tmp = new HashMap<>();
//        deploymentList.forEach(
//                deployment -> {
//                    if (deployment instanceof DeploymentEntityImpl) {
//                        DeploymentEntityImpl deploymentEntity = (DeploymentEntityImpl) deployment;
//                        deploymentEntity.setResources(tmp);
//                    }
//                });
//
//        ListResult<Deployment> result = new ListResult<>(CommonCode.SUCCESS);
//        result.setList(deploymentList);
//        return result;
//    }
//
//    /**
//     * 级联移除工作流（移除该流程的所有数据，包括正在执行的信息和历史信息）
//     */
//    @Transactional
//    @RequestMapping("cascade-remove")
//    public ObjResult cascadeRemove(@RequestBody PageData pd) {
//        String deploymentId = pd.getString("deploymentId");
//        repositoryService.deleteDeployment(deploymentId, true);
//        return new ObjResult(CommonCode.SUCCESS);
//    }
//}
